package gui.creators;

import events.antEvents.PheromonesDroppedEvent;
import framework.events.Event;
import framework.gui.GUI;
import framework.gui.GUIObject;
import framework.gui.GUIObjectCreator;
import gui.objects.GUIPheromoneDrop;

public class GUIPheromoneCreator extends GUIObjectCreator {

	public GUIPheromoneCreator(GUI gui) {
		super(gui);
	}

	@Override
	protected GUIObject createGUIObject(Event event) {
		if (event instanceof PheromonesDroppedEvent) {
			PheromonesDroppedEvent e = (PheromonesDroppedEvent) event;
			return new GUIPheromoneDrop(e.getPosition());
		} else {
			throw new IllegalStateException();
		}
	}

	@Override
	protected Class<? extends Event> getCreationEventClass() {
		return PheromonesDroppedEvent.class;
	}

	@Override
	protected Class<? extends Event> getDestroyEventClass() {
		return null;
	}

	@Override
	protected GUIObject getDestroyGUIObject(Event event) {
		throw new UnsupportedOperationException();
	}
}
